package com.jg.service.impl;

import com.jg.entity.Student;
import com.jg.mapper.StudentMapper;
import com.jg.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 86130
 * @version 1.0
 * @description: TODO
 * @date 2025/6/6 上午11:29
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> findAllStudent() {
        return studentMapper.findAllStudent();
    }

    @Override
    public void findStudentById(Integer id) {
        studentMapper.findStudentById(id);
    }

    @Transactional
    @Override
    public int addStudent() {
        return studentMapper.addStudent();
    }

    @Transactional
    @Override
    public int updateStudent(Integer id) {
        return studentMapper.updateStudent(id);
    }

    @Transactional
    @Override
    public int deleteStudent(Integer id) {
        return studentMapper.deleteStudent(id);
    }
}
